package cn.lutu.domain.repository.impl;

import cn.lutu.dao.mapper.AuthorityMapper;
import cn.lutu.dao.mapper.RoleAuthorityMapper;
import cn.lutu.domain.repository.AuthorityRepository;
import cn.lutu.protocol.entity.RoleAndAuthority;
import cn.lutu.protocol.vo.AuthorityVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

@Slf4j
@Repository
public class AuthorityRepositoryImpl implements AuthorityRepository {
    @Autowired
    RoleAuthorityMapper roleAuthorityMapper;

    @Autowired
    AuthorityMapper authorityMapper;

    @Override
    public int insert(RoleAndAuthority roleAndAuthority) {
        return roleAuthorityMapper.insert(roleAndAuthority);
    }

    @Override
    public List<AuthorityVO> selectAll() {
        return authorityMapper.selectAll();
    }
}
